home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2001 May / SGI IRIX Base Documentation 2001 May.iso / usr / share / catman / p_man / cat3 / perl5 / Cwd.z / Cwd
Encoding:
Text File  |  1998-10-30  |  2.3 KB  |  67 lines

  1.  
  2.  
  3.  
  4. CCCCwwwwdddd((((3333))))                                                                  CCCCwwwwdddd((((3333))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      getcwd - get pathname of current working directory
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.          use Cwd;
  13.          $dir = cwd;
  14.  
  15.          use Cwd;
  16.          $dir = getcwd;
  17.  
  18.          use Cwd;
  19.          $dir = fastgetcwd;
  20.  
  21.          use Cwd 'chdir';
  22.          chdir "/tmp";
  23.          print $ENV{'PWD'};
  24.  
  25.  
  26. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  27.      The _g_e_t_c_w_d() function re-implements the _g_e_t_c_w_d(3) (or _g_e_t_w_d(3)) functions
  28.      in Perl.
  29.  
  30.      The _f_a_s_t_c_w_d() function looks the same as _g_e_t_c_w_d(), but runs faster.  It's
  31.      also more dangerous because it might conceivably _c_h_d_i_r() you out of a
  32.      directory that it can't _c_h_d_i_r() you back into.  If fastcwd encounters a
  33.      problem it will return undef but will probably leave you in a different
  34.      directory.  For a measure of extra security, if everything appears to
  35.      have worked, the _f_a_s_t_c_w_d() function will check that it leaves you in the
  36.      same directory that it started in. If it has changed it will die with the
  37.      message "Unstable directory path, current directory changed
  38.      unexpectedly". That should never happen.
  39.  
  40.      The _c_w_d() function looks the same as getcwd and fastgetcwd but is
  41.      implemented using the most natural and safe form for the current
  42.      architecture. For most systems it is identical to `pwd` (but without the
  43.      trailing line terminator).
  44.  
  45.      It is recommended that cwd (or another *_c_w_d() function) is used in _a_l_l
  46.      code to ensure portability.
  47.  
  48.      If you ask to override your _c_h_d_i_r() built-in function, then your PWD
  49.      environment variable will be kept up to date.  (See the section on
  50.      _O_v_e_r_r_i_d_i_n_g _B_u_i_l_t_i_n _F_u_n_c_t_i_o_n_s in the _p_e_r_l_s_u_b manpage.) Note that it will
  51.      only be kept up to date if all packages which use chdir import it from
  52.      Cwd.
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.